<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box1{
            width: 100px;
            height: 100px;
            background-color: #bfa;
            transition: 2s;
            margin: 100px auto;

            /* 缩放的原点 */
            transform-origin: 50px;
        }
        .box1:hover{
            /*
                缩放
                    scaleX()对X轴放大多少倍
                    scaleY()对Y轴放大多少倍
                    scale（）双方向放大

                    想看z轴效果
                    要打开transform-style的3D效果
             */
            transform: scaleX(2);
        }
        .img-wrapper{
            width: 100px;
            height: 100px;
            border: 1px solid red;
            position: absolute;
            top: 0;
            /* 裁剪超过边框的 */
            overflow: hidden;
        }

        .img-wrapper:hover img{
            transform: scale(1.2);

        }
        img{
            /* 给图片增加过渡效果 */
            transition: 2s;
        }
    </style>
</head>
<body>
    <div class="box1"></div>
    <div class="img-wrapper">
        <img width=100% src="../mi/img/Qcode.png" alt="">
    </div>
</body>
</html>